﻿using System;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Windows.Data;
using Notes.Model;

namespace Notes.Converters
{
    public class PhotosToListVisibility : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                try
                {
                    ObservableCollection<Photo> photos = (ObservableCollection<Photo>)value;
                    if (photos.Count > 0)
                        return true;
                }
                catch { }
            }
            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

    }
}
